<div class="zs-body" data-ng-init="
		formInit('services', {
			keyField:'id',
			randomFields:['id']
		}) && 
		formInit('menus', {
			keyField:'id',
			randomFields:['id']
		}) && 
		formInit('datas', {
			keyField:'id',
			randomFields:['id']
		}) && 
		formInit('mapLayers', {
			keyField:'id',
			randomFields:['id']
		}) && 
		formInit('mapExtents', {
			keyField:'id',
			randomFields:['id']
		}) && 
		formInit('role', {
			keyField:'id',
			randomFields:['id'],
			orderObject:{order:0},
			queryFields:'id,display,code,valid,info,groupName,order',
			pageSize:12
		}) && loadData('role');setConHei();">
    <div class="zs-map-tool">
        <div class="location">
            <a href="javascript:;">首页</a>
            <i class="right-arr"></i>
            <a href="javascript:;">运维管理</a>
            <i class="right-arr"></i>
            <a href="javascript:;">角色管理</a>
        </div>
        <div class="option">
            <input type="button" class="zs-btn orange" value="新建" 
                ng-click="addRow('role') && openWindow('edit');"/>
            <input type="button" class="zs-btn orange" value="编辑" 
                ng-click="editRow('role', role.sRows[0]) && openWindow('edit')"/>
            <input type="button" class="zs-btn orange" value="删除 "
                ng-click="delEntitys('role')"/>
            <input type="button" class="zs-btn orange" value="角色授权"
                ng-click="editRow('role', role.sRows[0]) && openWindow('edit2')"/>
            <input type="button" class="zs-btn orange" value="角色成员"
                ng-click="searchUser(role.sRows[0]) && openWindow('edit3')"/>
        </div>
    </div>
    <div class="zs-content" style="position:unset">
        <div class="zs-nice-tab idTabs">
        	<div class="tool item" style="margin-left:6px;">
                <span class="search-warpper">
                    <i class="icon"></i>
                    <input type="text" placeholder="所属分组" class="zs-input" ng-model="role.queryObject['groupName:like']"/>
                </span>
            </div>
            <div class="tool item" style="margin-left:6px;">
                <span class="search-warpper">
                    <i class="icon"></i>
                    <input type="text" placeholder="角色名称" class="zs-input" ng-model="role.queryObject['display:like']"/>
                </span>
            </div>
            <div class="operation item">
                <a class="ope-1" ng-click="loadData('role')"></a>
                <a class="ope-2"></a>
            </div>
            <div class="switch">
            </div>
        </div>
        <div class="date-container">
            <div id="zpgwd">
                <div class="zs-data-table">
                    <div class="container">
                    	<table>
	                        <thead>
			                    <tr>
			                        <th>
			                        	<input id="allCheckbox" type="checkbox"
			                        		ng-click="selectAll('role','allCheckbox');">
			                        </th>
			                        <th>序号</th>
			                        <th>名称</th>
			                        <th>所属分组</th>
			                        <th>是否有效</th>
			                        <th>备注</th>
			                    </tr>
			                </thead>
			                <tbody>
			                    <tr ng-repeat="r in role.datas">
					                <td><input type="checkbox"
						                    ng-click="selectRow('role',r);"
						                    ng-model="r.selected" />
					                </td>
					                <td>
					                    <a ng-click="editRow('role',r) && openWindow('edit');">
					                        <label ng-bind="r.order"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('role',r) && openWindow('edit');">
					                        <label ng-bind="r.display"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('role',r) && openWindow('edit');">
					                        <label ng-bind="r.groupName"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('role',r) && openWindow('edit');">
					                        <label ng-bind="r.valid | asChineseBool"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('role',r) && openWindow('edit');">
					                        <label ng-bind="r.info"></label>
					                    </a>
					                </td>
					            </tr>
			                </tbody>
                        </table>
                    </div>
                </div>
                <div class="zs-pagination-box">
                    <ag-Page fn='role'></ag-Page>
                </div>
            </div>
        </div>

        <div ag-Window id="edit" title="角色编辑" width='560px' height='180px'>
	        <div class="zs-form-tab ibox">
	        	<form name="form" novalidate>
				    <table>
				        <tbody>
	                        <tr>
	                            <td class="text" width="20%">*角色名称</td>
	                            <td class="left" width="30%"><input type="text" alias="角色名称"
	                                name="display" ng-model="role.editRow.display"
	                                class="zs-input" required></td>
	                            <td class="text" width="20%">*所属分组</td>
	                            <td class="left" width="30%"><input type="text" alias="所属分组"
	                                name="groupName" ng-model="role.editRow.groupName"
	                                class="zs-input" required></td>
	                        </tr>
	                        <tr>
		                        <td class="text" width="20%">是否有效</td>
		                        <td class="left" width="30%">
		                        	<input type="checkbox" ng-model="role.editRow.valid"
		                        		ng-true-value="true" ng-false-value="false" value='false' />
		                        </td>
		                        <td class="text" width="20%">排序</td>
		                        <td class="left" width="30%"><input type="text"
		                            class="zs-input" ng-model="role.editRow.order">
		                        </td>
		                    </tr>
	                        <tr>
	                            <td class="text" width="20%">角色描述</td>
	                            <td colspan="3" class="left" width="80%"><input type="text"
	                                ng-model="role.editRow.info" class="zs-input"></td>
	                        </tr>
				        </tbody>
				        <tfoot>
				            <tr>
				                <td colspan="5">
				                    <input type="button" name="ok" value="保存" class="zs-btn c-red"
				                    	ng-click="formValidate(form) && save('role', role.editRow, saveCloseWindow)"/>
				                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
				                    	ng-click="closeWindow('edit')" />
				                </td>
				            </tr>
				        </tfoot>
				    </table>
				</form>
			</div>
	    </div>

	    <div ag-Window id="edit2" title="角色授权" width='500px' height='610px'>
	        <div class="zs-form-tab ibox" data-ng-init="iniTab('datatab', 'tab5', 'selected');">
	        	<form name="form2" novalidate>
	        		<div class="zs-itab">
						<div class="zs-itab-title">
							<ul class="idTabs">
								<li><a ng-click="setTab('datatab', 'tab5');" 
									class="{{tabs['datatab'].tabClass['tab5']}}">业务系统</a></li>
								<li><a ng-click="setTab('datatab', 'tab1');" 
									class="{{tabs['datatab'].tabClass['tab1']}}">菜单功能权限</a></li>
								<li><a ng-click="setTab('datatab', 'tab2');" 
									class="{{tabs['datatab'].tabClass['tab2']}}">数据功能权限</a></li>
								<li><a ng-click="setTab('datatab', 'tab3');" 
									class="{{tabs['datatab'].tabClass['tab3']}}">图层功能权限</a></li>
								<li><a ng-click="setTab('datatab', 'tab4');" 
									class="{{tabs['datatab'].tabClass['tab4']}}">地图范围权限</a></li>
							</ul>
						</div>
					</div>

					<div ng-show="tabs['datatab'].tabShow['tab5']" style="height: 490px;margin:5px 10px">
					    <!-- <ag-Tree fn='registerservice'
					    	para="{	bindField:'functionId',
        							bindFn:'services',
									defaultQueryObject:{valid:true},
									orderObject:{order:0}}"
							ng-model="role.editRow.services"/> -->

						<ag-Tree 
							para="{ uDictionary:true,
									dictionary:'p_register_service',
        							bindField:'functionId',
        							bindFn:'services'}"
							ng-model="role.editRow.services"/>
				    </div>

					<div ng-show="tabs['datatab'].tabShow['tab1']" style="height: 490px;margin:5px 10px">

					    <!-- <ag-Tree fn='menujurisdiction'
					    	para="{	pidField:'pid',
        							leafField:'leaf',
        							bindField:'functionId',
        							bindFn:'menus',
									defaultQueryObject:{valid:true},
									queryObject:{pid:''},
									orderObject:{order:0}}"
							ng-model="role.editRow.menus"/> -->

						<ag-Tree 
							para="{ uDictionary:true,
									dictionary:'p_menu_jurisdiction',
									pidField:'pid',
        							leafField:'leaf',
        							onlyLeafCheck:true,
        							intLoadLevel:2,
        							bindField:'functionId',
        							bindFn:'menus'}"
							ng-model="role.editRow.menus"/>
				    </div>

				    <div ng-show="tabs['datatab'].tabShow['tab2']" style="height: 490px;margin:5px 10px">
					    <!-- <ag-Tree fn='datajurisdiction'
					    	para="{	pidField:'pid',
        							leafField:'leaf',
        							bindField:'functionId',
        							bindFn:'datas',
									defaultQueryObject:{valid:true},
									queryObject:{pid:''},
									queryFields:'id,display,code,valid,info',
									orderObject:{order:0}}"
							ng-model="role.editRow.datas"/> -->

						<ag-Tree 
							para="{ uDictionary:true,
									dictionary:'p_data_jurisdiction',
									pidField:'pid',
        							leafField:'leaf',
        							onlyLeafCheck:true,
        							intLoadLevel:2,
        							bindField:'functionId',
        							bindFn:'datas'}"
							ng-model="role.editRow.datas"/>
				    </div>

				    <div ng-show="tabs['datatab'].tabShow['tab3']" style="height: 490px;margin:5px 10px">
					    <!-- <ag-Tree fn='maplayerjurisdiction'
					    	para="{	pidField:'pid',
        							leafField:'leaf',
        							bindField:'functionId',
        							bindFn:'mapLayers',
									defaultQueryObject:{valid:true},
									queryObject:{pid:''},
									queryFields:'id,display,code,valid,info',
									orderObject:{order:0}}"
							ng-model="role.editRow.mapLayers"/> -->

						<ag-Tree 
							para="{ uDictionary:true,
									dictionary:'p_maplayer_jurisdiction',
									pidField:'pid',
        							leafField:'leaf',
        							onlyLeafCheck:true,
        							intLoadLevel:2,
        							bindField:'functionId',
        							bindFn:'mapLayers'}"
							ng-model="role.editRow.mapLayers"/>
				    </div>

				    <div ng-show="tabs['datatab'].tabShow['tab4']" style="height: 490px;margin:5px 10px">
					    <!-- <ag-Tree fn='mapextentjurisdiction'
					    	para="{	pidField:'pid',
        							leafField:'leaf',
        							bindField:'functionId',
        							bindFn:'mapExtents',
									defaultQueryObject:{valid:true},
									queryObject:{pid:''},
									orderObject:{order:0}}"
							ng-model="role.editRow.mapExtents"/> -->

						<ag-Tree 
							para="{ uDictionary:true,
									dictionary:'p_mapextent_jurisdiction',
									pidField:'pid',
        							leafField:'leaf',
        							onlyLeafCheck:true,
        							intLoadLevel:2,
        							bindField:'functionId',
        							bindFn:'mapExtents'}"
							ng-model="role.editRow.mapExtents"/>
				    </div>

					<div>
				    	<table width="100%">
				    		<tfoot>
				    			<tr>
				    				<td>
				    					<input type="button" name="ok" value="保存" class="zs-btn c-red"
					                    	ng-click="formValidate(form2) && save('role', role.editRow, saveCloseWindow)"/>
					                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
					                    	ng-click="closeWindow('edit2')" />
				    				</td>
				    			</tr>
				    		</tfoot>
				    	</table>
				    </div>
				</form>
			</div>
	    </div>

	    <div ag-Window id="edit3" title="角色成员" width='1000px' height='600px'>

	    	<div class="zs-content" style="position:unset" data-ng-init="formInit('vuserrole', {
					keyField:'userid',
					orderObject:{userid:0} 
				})">
		        <div class="zs-nice-tab idTabs">
		            <div class="tool item">
		            	<span class="search-warpper">
		                    <input type="checkbox" ng-model="searchCurRole"
	                    		ng-click="setSearch()"/>
	                    	只显示
	                    	【<label ng-bind="searchCurRoleName"></label>】
	                    	角色成员
		                </span>
		            </div>
		            <div class="tool item">
		            	<span class="search-warpper">
		                    <ag-Combotree class="zs-input" style="height:28px;"
	                    		para="{ uDictionary:true,
										dictionary:'p_organization',
										addSpace:true,
										pidField:'pid',
                						leafField:'leaf'}"
								ng-model="vuserrole.queryObject['organizationId:like']"/>
		                </span>
		            </div>
		            <div class="tool item">
		            	<span class="search-warpper">
		                    <i class="icon"></i>
		                    <input type="text" class="zs-input" ng-model="vuserrole.queryObject['userName:like']"/>
		                </span>
		            </div>
		            <div class="operation item">
		                <a class="ope-1" ng-click="loadUserData()"></a>
		            </div>
		            <div class="switch">
		            </div>
		        </div>
		        <div class="date-container">
		            <div id="zpgwd">
		                <div class="zs-data-table">
		                    <div class="container">
		                    	<table>
			                        <thead>
					                    <tr>
					                        <th></th>
					                        <th>姓名/帐号</th>
					                        <th>所属角色</th>
					                        <th>所属机构</th>
					                        <th>登录是否启用</th>
					                    </tr>
					                </thead>
					                <tbody>
					                    <tr ng-repeat="r in vuserrole.datas">
							                <td><input type="checkbox"
								                    ng-click="setUserRole(r);"
								                    ng-model="r.selected" />
							                </td>
							                <td style="text-align:-webkit-left">
							                    <label ng-bind="r.userName"></label>
						                        <label ng-if="r.accounts">/</label>
						                        <label ng-bind="r.accounts"></label>
							                </td>
							                <td style="text-align:-webkit-left">
							                    <label ng-bind="r.roleNames"></label>
							                </td>
							                <td style="text-align:-webkit-left">
							                    <label ng-bind="r.organizationName"></label>
						                        <label ng-bind="r.departmentName"></label>
						                        <label ng-bind="r.operatingPostName"></label>
							                </td>
							                <td style="text-align:-webkit-left">
							                    <label ng-bind="r.valid | asChineseBool"></label>
							                </td>
							            </tr>
					                </tbody>
		                        </table>
		                    </div>
		                </div>
		                <div class="zs-pagination-box">
		                    <ag-Page fn='vuserrole'></ag-Page>
		                </div>
		            </div>
		        </div>
		    </div>

	    </div>
    </div>
</div>